package cn.memset.sample;

import cn.memset.sample.classloaders.MyCommonClassLoader;
import cn.memset.service.api.Service;

/**
 * 自定义的类加载器测试程序
 */
public class CustomClassLoaderTest {
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        ClassLoader myLoader = new MyCommonClassLoader(
                "D:\\anyuanwai\\common-sdk");
        Class<?> serviceCls = Class.forName(
                "cn.memset.app.CompanyService",
                true,
                myLoader);

        Service service = (Service) serviceCls.newInstance();
        service.start();
    }
}
